require "utils"

class Link < ActiveRecord::Base
  include Utils
  belongs_to :ecase
  belongs_to :author, :class_name => "User", :foreign_key => "author_id"
  
  def before_save
    unless consists_of?(url, "http://")
      self.url = "http://" + url
    end
  end

  def category
    ResourceCategory::LINK
  end
end